home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SLTPU70C / SAMPLE1.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-25  |  999b  |  46 lines

  1.  
  2. Program Sample1;
  3.  
  4.   { Sample program to list subboards and file directories }
  5.  
  6. Uses Crt,Multi,Filedef,SubList;
  7.  
  8. var c: char;
  9.     p: sublistptr;
  10.     i: integer;
  11.  
  12. Begin
  13.  
  14.   { Open CONFIG and NODES files }
  15.   if OpenFiles([CONFIGF,NODESF]) then begin
  16.  
  17.     { Initialize list of subboards or filedirs }
  18.     repeat
  19.       write('Do you want to list [S]ubboards or [F]iledirs? ');
  20.       { Minimize CPU time while waiting for keystroke }
  21.       while not Keypressed do Slice;
  22.       c:=Upcase(readkey);
  23.       writeln(c);
  24.     until (c in ['S','F']);
  25.     writeln;
  26.  
  27.     case c of
  28.       'S': SubListInit(Subboards);
  29.       'F': SubLIstInit(Filedirs);
  30.     end;
  31.  
  32.     p:=SubListRoot;          { root of subboard/filedir list in RAM }
  33.     while p<>Nil do begin
  34.       write(p^.fname);
  35.       for i:=1 to 12-length(p^.fname) do
  36.         write(' ');
  37.       writeln(p^.name);
  38.       p:=p^.next;
  39.     end;
  40.  
  41.  
  42.     CloseAllFiles;
  43.   end
  44.   else writeln('Could not open CONFIG File!');
  45.  
  46. end.